package com.hao.user.app.model.dto.user;

import lombok.Data;
import org.hibernate.validator.constraints.Length;


import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author haoge
 * @version 1.0
 * @date 2023/5/21 10:55
 */
@Data
public class UserRegisterRequest implements Serializable {

    private static final long serialVersionUID = 4120993142073946664L;

    @NotBlank(message = "账号不能为空")
    @Length(min = 4,message = "用户账号长度过短")
    @NotNull(message = "账号不能为空")
    private String userAccount;

    @NotNull (message = "性别不能为空")
    private Integer gender;

    @NotBlank(message = "密码不能为空")
    @Length(min = 8,message = "密码过短")
    @NotNull(message = "密码不能为空")
    private String password;

    @NotBlank(message = "请再次输入密码")
    @Length(min = 8,message = "密码过短")
    @NotNull(message = "请再次输入密码")
    private String checkPassword;

    @NotBlank(message = "邮箱不能为空")
    @NotNull(message = "邮箱不能为空")
    @Email(message = "邮箱格式不对")
    private String email;

    @NotBlank(message = "手机号不能为空")
    @NotNull(message = "手机号不能为空")
    @Length(min = 11,max = 11,message = "请输入正确的手机号")
    @Pattern (regexp = "1[3|4|5|7|8][0-9]\\d{8}",message = "手机号格式不对")
    private String phone;
}
